Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[junit] Fix JUnit generated XML report. #123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jstourac
Copy link
Contributor

Based on the Maven surefire-plugin JUnit XSD schema [1], name
attribute in testcase is required. Let's use description value
that is currently used as classname attribute for this purpose.

This issue may lead to errors with JUnit plugin 1.32 for Jenkins.

[1] https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd

@jstourac
Copy link
Contributor Author

Update: actually version 1.33 of the Jenkins JUnit plugin has fixed the occurring NPE which was present during the plugin execution in version before. So even though there is no working issue now, still formally the XSD schema requires the name attribute.

I'll keep on your decision whether you feel more to merge/update or close this.

Based on the Maven surefire-plugin JUnit XSD schema [1], `name`
attribute in `testcase` is required. Let's use description value
that is currently used as `classname` attribute for this purpose.

This issue may lead to errors with JUnit plugin 1.32 for Jenkins.

[1] https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd
@jstourac
Copy link
Contributor Author

Hi there :) Is there any chance this gets merged? Even though this doesn't make problem to the Jenkins plugin anymore, it still violates the XSD format expected by the Maven surefire plugin. Or shall we follow some different XSD instead that one?

@fasterthanlime
Copy link

fasterthanlime commented Jan 6, 2023

I'm also running into this as I'm attempting to show h2spec results from CI using a GitHub action like test-reporter - I suspect that's where it's choking:

  Error: Processing test results from h2spec-junit.xml failed
Error: TypeError: Cannot read properties of undefined (reading 'trim')

https://github.com/dorny/test-reporter/blob/e9fa2f582c0ebbe2e263fd18fad744d52e0b0203/src/parsers/java-junit/java-junit-parser.ts#L100


edit: that was it, this patch fixes it for me: https://github.com/hapsoc/hring/actions/runs/3856947194/jobs/6573802085

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants